Florian Müllner [Sat, 2 Dec 2017 00:27:35 +0000 (01:27 +0100)]
cleanup: Use Function.prototype.bind()
When not using arrow notation with anonymous functions, we use Lang.bind()
to bind `this` to named callbacks. However since ES5, this functionality
is already provided by Function.prototype.bind() - in fact, Lang.bind()
itself uses it when no extra arguments are specified. Just use the built-in
function directly where possible, and use arrow notation in the few places
where we pass additional arguments.
Florian Müllner [Tue, 31 Oct 2017 00:38:18 +0000 (01:38 +0100)]
cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base
to bind `this` to anonymous functions, replacing the more overbose
Lang.bind(this, function() {}).
Florian Müllner [Wed, 21 Feb 2018 13:03:18 +0000 (14:03 +0100)]
tests: Set calendar event source
Ever since commit e9e30138bd6 (2011!), the calendar only initialized
the header at construction time. Set an event source to trigger an
update of the content area, which is what the test is mainly intended
for.
Florian Müllner [Wed, 21 Feb 2018 12:01:56 +0000 (13:01 +0100)]
tests: Fix gnome-shell theme import
The current import rule fails in two ways:
- commit c62e7a6a moved the theme's stylesheet to the builddir
- since commit 49c4ba56, assets are addressed as resource:// URIs
Fix both issues by loading and referencing the theme resource instead
of the stylesheet itself.
Florian Müllner [Wed, 21 Feb 2018 12:09:48 +0000 (13:09 +0100)]
keyboard: Fix a warning
imports.misc.ibusManager.IBus is declared as const, so referencing it
from another module triggers a warning with recent mozjs. As of commit 083d11a0327 IBus is mandatory, so just make it a regular import to avoid
the warning.
Ray Strode [Thu, 13 Nov 2014 14:26:52 +0000 (09:26 -0500)]
loginDialog: only emit session-activated on user action
Right now we emit session-activated any time the bullet
moves in the session menu. That includes at startup when
picking an item arbitrarily, and any time GDM reports the
session was read from the user's account settings.
session-activated informs GDM about the newly selected session,
so emitting it in response to GDM reporting a session is a
bad idea.
This commit changes the code to only emit session-activated when
the user explicitly activates a session item from the gear menu.
Note, we no longer set the active session explicitly at start up.
This is a good thing since the item we were picking wasn't
necessarily correct. It does means if GDM fails to inform us
about the correct default session we'll now show no bullet instead
of a bullet on the wrong item.
Ray Strode [Tue, 18 Aug 2015 16:02:17 +0000 (12:02 -0400)]
gdm: honor timed login delay even if animations disabled
gnome-shell currently initiates an automatic login attempt if
timed login is enabled and the timed login animation completes.
Unfortunately, if animations are disabled (as is the case for
virtual machines) then the timed login animation will complete
instantly, and timed login will proceed immediately after gnome-shell
has noticed the user is idle for 5 seconds.
This commit addresses that problem by initiating timed login and the
animation from a main loop timeout, instead of using the tweener api.
Florian Müllner [Tue, 20 Feb 2018 09:24:24 +0000 (10:24 +0100)]
build: Minor cleanups
find_program() defaults to require the program in question, and as
failing to locate it is now fatal, there's no longer a need for
checking whether it was found later.
Carlos Garnacho [Thu, 15 Feb 2018 17:57:19 +0000 (18:57 +0100)]
theme: Update OSK theme
Enter/shift/layout/hide buttons have been made to use our own assets, key
labels have been made slightly bigger, and incorrect padding has been
removed from the extended keys popovers.
Carlos Garnacho [Thu, 15 Feb 2018 13:48:46 +0000 (14:48 +0100)]
keyboard: Set 'latched' pseudo-class on latched shift key
This is pseudo-class is added on .shift-key-uppercase whenever the shift
state is latched, a matching selector would be:
.keyboard-key.shift-key-uppercase:latched {}
Carlos Garnacho [Thu, 15 Feb 2018 12:46:19 +0000 (13:46 +0100)]
keyboard: Delegate enter/shift/layout/hide buttons style to theming
Drop the UTF8 glyphs from those, and add style classes so those can be
specifically themed and given a background image. The style classes are:
.keyboard-key.enter-key{}
.keyboard-key.shift-key-lowercase{} /* applies while lowercase */
.keyboard-key.shift-key-uppercase{} /* applies while uppercase */
.keyboard-key.layout-key{}
.keyboard-key.hide-key{}
Carlos Garnacho [Thu, 15 Feb 2018 12:23:54 +0000 (13:23 +0100)]
keyboard: Avoid using key.label for anything else than presentation
Do the finicky checks to adjust key widths and whatnot based on other
values than the label. This makes the label exclusively used for
presentation (i.e. setting up a St.Label).
Carlos Garnacho [Thu, 15 Feb 2018 11:20:51 +0000 (12:20 +0100)]
keyboard: Shift key shouldn't latch the state unless long pressed
Instead of latching all states, make shift unlatched by default, and only
latched when making a long press on the key. When not latched, the keyboard
will switch to the first level (alphabetic lowercase) after the first key
press.
Also, move the actual level switch to Key::pressed, so it feels more
reactive on long press.
Carlos Garnacho [Wed, 14 Feb 2018 11:39:27 +0000 (12:39 +0100)]
keyboard: Do key presses on actual key press
It was mistakenly connecting twice to the 'released' signal. Also, move
level changes to key release, since it will be more convenient to hook
latched states on long press.
Carlos Garnacho [Sun, 11 Feb 2018 15:19:10 +0000 (16:19 +0100)]
keyboard: make Key objects' topmost actor to be this.actor
These objects created this.actor being the St.Button, and a surrounding
this.container actor that is the actual actor callers care about. Turn this
around and make this.actor be the parent-less actor, and this.keyButton the
contained internal button. This is more consistent with gnome-shell style.
Carlos Garnacho [Sun, 11 Feb 2018 15:15:14 +0000 (16:15 +0100)]
keyboard: Do not call non-existent function
Commit 8fdf47ea5b5 removed _addKeys(), but forgot one caller. We just want
to regenerate the keyboard for the current group, so call into the
_onGroupChanged function.
build: Make sassc mandatory and always generate CSS files from Sass sources
The previous implementation of the CSS generation logic considered sassc
an optional dependency and made sure for that reason that the result CSS
files ended up in the source directory, so that they could be checked
in and kept in sync with the source sass files.
As we are making sassc a required dependency, we can now stop doing that
extra work and simply rely on the CSS files being automatically generated
each time the sass sources change. By doing this, we can now effectively
get rid of the CSS files checked in the repo as well as of the parse_sass.sh
script, since the CSS files will now live on the build directory only.
Nikita Churaev [Fri, 5 Jan 2018 23:54:33 +0000 (02:54 +0300)]
appDisplay: Fix small app folder icons when using HIDPI
While the scale factor is taken into account for app icons, we set
an explicit size when combining the into a folder icon - unless we
take the factor into account, the result will be too small on HiDPI
displays.
Carlos Garnacho [Fri, 9 Feb 2018 23:18:26 +0000 (00:18 +0100)]
viewSelector: Avoid stealing focus from other entries into overview entry
The captured-event handler just redirects focus there on the first keypress,
what it doesn't account for is that other entries may be active while the
Activities overview is opened (eg. alt-f2, or other modal dialogs). Play
along with other entries, and make it only steal focus if no other entry
is selected.
Florian Müllner [Fri, 9 Feb 2018 18:22:55 +0000 (19:22 +0100)]
theme: Replace gnome-shell-sass submodule with subtree
As the style has grown bigger and more complex, generating the different
variants from a common source has been a good decision. However given how
intertwined the theme is with gnome-shell itself, relying on a submodule
has proven to be quite painful. And as things stand right now, it is going
to get worse:
- using either pre-generated CSS or generating it at build time is
odd, and violates meson's strict separation between source- and
build directories; we are therefore considering dropping the CSS
and depending on sassc to always generate it at build time
- with the migration to gitlab, our workflow shifts decisively towards
branches; however there is no support in either git or gitlab for
handling two brances of separate repositories consecutively, which
gets particularly awkward for branches in a private namespace
With those pain points in mind, we will adjust our setup as follows:
- remove the submodule from gnome-shell and instead import the
sass as subtree
- after that, the sass sources can be changed like any other files
in the repository, and regular contributors can forget that there
was ever anything special about them
- whenever we want to update the classic style, we can push the subtree
changes and bump gnome-shell-extension's sass submodule
In other words: Updating the classic styling will become slightly more
painful, but not much and only for me; in return, everyone else can
stop fiddling with submodules (and buy me a beer).
altTab: Add also a shortcut to close windows from the switcher popups
Similar to what has been done for the apps switcher, this allows closing
windows pressing W or F4 while operating the windows switcher popup or
the apps switcher popup while navigating the list of windows for an app.
switcherPopup: Handle removal of items from SwitcherPopup
This will be mainly useful for closing apps from the applications
switcher, but can be implemented generically enough to select the
nearest existing item after removal if there's any, or destroying
the popup's actor otherwise.
Specifically for the apps switcher, doing this also removes the need
of having to manually either update the current app in AppSwitcher
and highlight it, if there are still any items after the removal, or
simply destroy the AppSwitcher otherwise. Besides, calling _select()
in the handler for item-removed makes sure that the list of thumbnails
in the switcher is always closed, if open, when quitting the app.
Florian Müllner [Thu, 8 Feb 2018 10:38:04 +0000 (10:38 +0000)]
altTab: Update the switcher when apps and/or windows get stopped/closed
Make sure that the items from the applications switcher and the windows
switcher are removed when the related applications get stopped, or some
of the associated windows closed.
Rafal Luzynski [Thu, 8 Feb 2018 11:47:26 +0000 (12:47 +0100)]
calendar Preparing for genitive/nominative months
glibc 2.27 introduced new format specifiers for the month names.
It's obligatory to use them in several languages already and it's
encouraged to use them for all languages because it is not destructive
for any language. As more languages are expected to follow this
standard it's better to use the "%OB" format specifier now so it will
start working correctly automatically.
See also: https://sourceware.org/bugzilla/show_bug.cgi?id=10871
This standard has been also working in BSD and OS X since 1990s,
if anyone tries to use gnome-shell in these systems.
Note: This will not work correctly with glibc < 2.27, there is no
detection whether the system is old or new.
Florian Zwoch [Wed, 7 Feb 2018 09:31:33 +0000 (09:31 +0000)]
shell-recorder: save cursor's image hot x/y coordinates
Whenever a new cursor image is loaded also save it's hot x/y
coordinates. The drawing code already respects these values, however
they were never set. This change will place the cursor image at the
correct location as seen on screen. shell-screenshot.c served as
reference.
Florian Müllner [Mon, 5 Feb 2018 10:37:09 +0000 (11:37 +0100)]
screenShield: Do not save lock state on wayland
We keep track of the lock state and restore it on startup to prevent
a crash from bypassing the screen lock. However on wayland, a crash
doesn't result in gnome-session restarting gnome-shell, but brings
down the entire session - that is, restoring the lock state does not
actually protect the existing session in that case, but forces the
user to authenticate twice in order to start the next session. This
is clearly not helpful, so avoid this by not saving the state when
running as wayland compositor.
Didier Roche [Tue, 9 Jan 2018 08:39:06 +0000 (09:39 +0100)]
panel: center date entry with workarea
Align and center the date entry with the workspace's workarea.
This way, maximized applications have their window aligned with the top date
entry.
This doesn't change anything for desktops with no docks or when left/right
workareas are aligned with the monitor.
The offset is leftOffset - rightOffset:
(workArea.x - monitor.x) - (monitor.width - ((workArea.x - monitor.x) +
workArea.width))
We will now basically act as "policy provider" for thunderbolt
peripherals by using org.freedesktop.bolt service: when new
devices are connect and session is a unlocked user session
we will automatically enroll (authorize and store in the database)
them.
If new devices are connected but the session is locked a message
will be shown informing the user that the device needs to be
reconnected to properly work.
The org.freedesktop.bolt service is provided by the "bolt" daemon.
Carlos Garnacho [Tue, 23 Jan 2018 15:45:46 +0000 (16:45 +0100)]
keyboard: Add languages selection popup
Currently the language options displayed pretty much mirror those of the
top bar keyboard layout selection popup. It may make sense in the future
to only list languages, and automatically switch to the enabled IMs that
the OSK can benefit from (eg. by filling in suggestions).
Carlos Garnacho [Wed, 11 Oct 2017 07:58:58 +0000 (09:58 +0200)]
keyboard: slide focused window on OSK visibility
The focused window will move up/down together with the OSK if the focus
area happens to be covered by the area to be covered by the OSK. This
state is reverted whenever the window loses focus, given it wasn't
relayout in between.
Carlos Garnacho [Wed, 17 Jan 2018 16:01:24 +0000 (17:01 +0100)]
misc: Make IBus a mandatory dependency
IBus was initially made optional as gnome-shell depended on too
recent API. This API is now old enough and gnome-shell is committing
further to IBus by implementing a ClutterInputMethod through it.
Let's just make IBus a mandatory dependency, instead of making code
paths trickier to cater for situations where it's missing.
Carlos Garnacho [Fri, 22 Dec 2017 14:59:19 +0000 (15:59 +0100)]
keyboard: Move extended keys pop up/down into the Key object
We do not need the parent Keyboard object to handle those specially, the
code can be self-contained enough. The Key object will simply emit
pressed/released events containing the keycode/string, be it from the
parent key or one contained in the BoxPointer.
Carlos Garnacho [Fri, 22 Dec 2017 11:30:11 +0000 (12:30 +0100)]
viewSelector: Send first printable keystroke to the search entry
StIMText used to handle key events for IM consumption in the capture phase,
this made the search box work automagically with nothing explicitly focusing
it. Since it's no longer the case, it has to be done somewhere.
Carlos Garnacho [Wed, 20 Dec 2017 12:08:50 +0000 (13:08 +0100)]
keyboard: add a special KeyContainer actor to contain keyboard layers
Instead of manually resizing each key everytime the keyboard needs to
relayout, have a special grid container that will preserve aspect when
resized.
This actor works in two stages though, first the keys need to be added
and then layoutButtons() need to be called for the actors to be
reparented to the container with the right attachment options.
Carlos Garnacho [Tue, 5 Dec 2017 19:05:00 +0000 (20:05 +0100)]
misc: Add InputMethod class
This is a ClutterInputMethod implementation using IBus underneath. The
input method will interact with the currently focused ClutterInputFocus,
be it shell chrome or wayland clients through the text_input protocol.
Carlos Garnacho [Fri, 1 Dec 2017 19:17:17 +0000 (20:17 +0100)]
keyboard: Ensure to resize keys after layer change
The keys possibly need resizing after a (new) layer has been set, there's
however calling places that don't. Instead, fold this._redraw() into
setActiveLayer().
Carlos Garnacho [Fri, 10 Nov 2017 17:29:53 +0000 (18:29 +0100)]
st: Make st_button_fake_release() work with touch press
The st_button_release() call wouldn't happen because StButton does not
set priv->button_mask on touch events. And if we make it called, we can't
try to unset the device grab at the end of the function, as device/sequence
are unset earlier on.
Carlos Garnacho [Thu, 10 Aug 2017 19:06:25 +0000 (21:06 +0200)]
data: Add keyboard layout JSON files
These have been created with the script at
git://repo.or.cz/cldr2json.git to translate the XML android
keymaps at http://www.unicode.org/Public/cldr/latest/keyboards.zip
into JSON, easier to parse from gnome-shell.
Getting the necessary "setting enabled, or input from touchscreen"
conditions to have the OSK shown are not enough on the lack of a
current focus. As we are setting up the caret tracker here, wait for
the focus in event before showing the keyboard.
This fixes 2 issues, with the setting disabled it became really hard
to get the OSK hidden on eg. touchscreen->pointer device switches,
as visibility only depended on the a11y setting here. And secondly,
enabling the setting would always end up with the OSK being shown
regardless of focus, while it should stay hidden if there's no text
edition.
Carlos Garnacho [Fri, 19 Jan 2018 09:45:50 +0000 (10:45 +0100)]
padOsd: Ensure to pick pad devices only
If the underlying X11 input driver creates multiple devices from a single
device node, we may end up picking up the wrong device. So, instead of
picking the first device based on node and bailing out if it's not a pad,
pick the first pad that has that device node, and bail out if there is
none.